<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class OrderRequest extends FormRequest
{

    public function rules()
    {
        return [
            'title' => 'required|max:10',
            'content' => 'required',
            'price' => 'required|numeric',
            'kind' => 'required',
        ];
    }

    public function messages()
    {
        return [
          'required' => ':attribute 为必填项',
          'numeric' => ':attribute 格式错误'
        ];
    }

    public function attributes()
    {
        return [
            'title' => '订单标题',
            'content' => '订单内容',
            'price' => '酬金',
            'kind' => '订单类型'
        ];
    }
}
